import os
from PIL import Image
import numpy as np
from segment_anything import SamAutomaticMaskGenerator, sam_model_registry
import matplotlib.pyplot as plt
import torch
import random
from tqdm import tqdm
import argparse
import warnings
warnings.filterwarnings('ignore', category=UserWarning)

from utils.common import check_and_create_directory, list_all_files, chunk_list
from utils.auto_sam import auto_sam
from utils.vit.vit import vit_encode


if __name__ == '__main__':
    
    parser = argparse.ArgumentParser(description='Process some paths.')
    parser.add_argument('--mode', type=str, required=True, help='Mode (train/val)')
    args = parser.parse_args()

    mode = args.mode
    input_path = '/home/zry/datasets/building/%s/rgbs' % mode
    output_path = '/home/zry/datasets/building/%s/seg' % mode
    tmp_path = '/home/zry/datasets/building/%s/tmp' % mode

    fencs = list_all_files(output_path, '.pth')
    pass
